package cn.zwxky.android.staff.Approve;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.zgscwjm.lsfbbasetemplate.LsfbFragment;
import com.zgscwjm.lsfbbasetemplate.annotation.OnClick;
import com.zgscwjm.lsfbbasetemplate.annotation.ViewInjectUtils;

import cn.zwxky.android.staff.R;
import cn.zwxky.android.staff.Utils.Permission;

/**
 * Created by Administrator on 2017/3/29 0029.
 */

public class ApproveFragment extends LsfbFragment {


    /**
     * view 对象
     */
    private View view;

    /**
     * activity对象
     */
    private Activity mactivity;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_approve, null);
        ViewInjectUtils.inject(this, view);

        Permission permission=new Permission(mactivity);
        permission.GetMeshPermission();
        permission.GetAddressBookPermission();
        permission.GetLocationPermission2();

        return view;
    }

    /**
     * 用于存储activity对象
     *
     * @param activity
     */
    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        mactivity = activity;
    }

    /**
     * 点击事件
     * @param view
     */
    @OnClick({R.id.fg_approve_leave,R.id.fg_approve_task})
    public void onClick(View view){
        switch (view.getId()){
            //请假审批
            case R.id.fg_approve_leave:
             startActivity(new Intent(mactivity,LeaveActivity.class));
                break;
            //业务审批
            case R.id.fg_approve_task:
                startActivity(new Intent(mactivity,TaskActivity.class));
                break;
        }
    }


    @Override
    protected void Resume() {

    }

    @Override
    public void initData() {

    }
}
